/*
 * listpanel组件
 */
define(function(require, exports, module) {
	var meta = require("../../package.json")
	if(meta.themes){
		var themes = meta.themes;
		for(var i=0;i<themes.length;i++){
			var cssurl = '../theme/'+themes[i]+'/css/list.css';
			require.async(cssurl);
		}
	}
	var list_tpl = require("./list.tpl");
	var Widget = require("core/widget/dist/widget");
	var List = Widget.extend({
		template:list_tpl,
		loadData : function() {
			var list = this;
			var url = this.get("url");
			$.ajax({
				type : 'POST',
				url : url,
				success : function(data) {
					list.setModel(data);
				},
				dataType : 'json'
			});
		}
	});
	module.exports = List;
});